The present invention relates to a logical zooming method and apparatus for a directed graph in which hierarchical nodes are connected by arcs.
Conventionally, for CASE (Computer Aided Software Engineering) tools, a call relationship for program routines and a hierarchical relationship of classes are displayed by using a directed graph that uses nodes and arcs. Representations of such graphs are used by many other software programs to display object relationships. One example is a display function for hierarchical relationships in a call-relationship graph of routines for software available on the market, or in a graph of the development environment for an object oriented language, such as C++. FIG. 6 is a diagram showing the complete structure of a graph for routines or for a hierarchical class.
When such a directed graph becomes large as a result of the addition of nodes (see FIG. 6), and if an image of the entire graph is then displayed in a window on the display device of a PC, either names written in the nodes (e.g., routine names) are so small that they can not be read, or the graph itself is so complex that arcs are difficult to trace. To resolve this problem, various conventional tools are available that include a function for enlarging a portion of a graph (a zooming function). FIG. 7 is a diagram showing an enlarged view of the graph in FIG. 6 that was obtained by using a conventional zooming function.
By zooming in on a portion of the graphs the names in some of the nodes have become legible. However, it is not possible in every case to identify the nodes directly related to a target node, nor is it possible to obtain a good understanding of the structure of the graph. Thus, in the example in FIG. 7, the following problems have arisen:
(1) It is not possible to infer from the image that xe2x80x9cDxe2x80x9d is called by both xe2x80x9cAxe2x80x9d and xe2x80x9cC.xe2x80x9d More specifically, while the topmost node in FIG. 7 is xe2x80x9cAxe2x80x9d and the rightmost node at the second level from the top is xe2x80x9cC,xe2x80x9d because the graph was zoomed, neither node is shown on the screen; only the arrows leading from the nodes to xe2x80x9cDxe2x80x9d are visible; and
(2) It is not possible to obtain a good understanding of the structure of the entire graph. For example, that a specific node is called by many nodes cannot be understood unless that node is displayed on the screen.
To resolve the above shortcomings, it is one object of the present invention to provide for a directed graph a logical zooming method and apparatus, whereby in a display a node directly related to a target node is exaggerated and the structure of the entire graph can be readily understood.
To achieve the above object, according to the logical zooming method of the present invention, a directed graph is used in which hierarchical nodes are connected by arcs. In the directed graph, a node having a predetermined logical relationship with a selected node is displayed in a different manner than are other nodes. As a result, the appearance of a node directly related to a target node can be exaggerated.
As a specific preferred example, on a screen, the size of a displayed node logically near a selected specific node is enlarged, while the size of a displayed node logically distant from the selected specific node is reduced. When the hierarchy level of the selected node is n, distances between hierarchy levels n and n+1 and between hierarchy levels n and nxe2x88x921 are set so that it is easy to read the name of the selected node and the name of a node, connected by an arc, that uses the selected node as a start point or an end point. The sizes of the other nodes are reduced so that all the nodes can fit on the screen. As a result, the node directly related to the target node is exaggerated, and the structure of the graph can be readily understood.
As another preferred example, at each of the hierarchy levels n+1 and nxe2x88x921, relative to the hierarchy level n of the selected specific node, the transverse arrangement of nodes is changed, so that a node for which the selected node is a start point or an end point is positioned nearer the selected node. Therefore, the node directly related to the target node is exaggerated.
As an additional preferred example, when an arc connecting the specific node and a node having a predetermined logical relationship with the specific node is a dummy node that extends across a hierarchy, the dummy node is defined as a display dummy node for displaying, in that hierarchy, the node having the predetermined logical relationship with the selected specific node. The dummy node is displayed differently than the other nodes. As a result, when a node logically related to the specific node is located at a more distant hierarchy level, the relationship can be understood even when the size of the hierarchy level, at which is located the node having the predetermined logical relationship with the selected node, is reduced.
The logical zooming apparatus for a directed graph according to the present invention is an apparatus for logically zooming a directed graph in which a plurality of hierarchical nodes are connected by arcs. The logical zooming apparatus comprises: an input device for entering data; a display device for displaying a directed graph; an arc start/end input unit for reading node information at start points and end points of all the arcs to be processed; a graph information extractor for, based on start/end point information for all the arcs, internally generating graph information in which the nodes are linked together by the arcs; a coordinate calculator for determining the x-y coordinates for each node on the screen of the display device; and a graph information storage unit for storing for a display device information concerning the directed graph. Therefore, the logical zooming method, for a directed graph, of the present invention can be implemented.